<!DOCTYPE html>
<html lang="en">
 <head> 
  <meta charset="utf-8" /> 
  <title>js\editor.js</title> 
  <link rel="stylesheet" href="http://yui.yahooapis.com/3.8.0pr2/build/cssgrids/cssgrids-min.css" /> 
  <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css" /> 
  <link rel="stylesheet" href="../assets/css/main.css" id="site_styles" />  
  <script src="http://yui.yahooapis.com/combo?3.8.0pr2/build/yui/yui-min.js"></script> 
 </head> 
 <body class="yui3-skin-sam"> 
  <div id="doc"> 
   <div class="header"> 
    <a href="/"> 
     <div class="logo"> 
      <h3>RunJS</h3> 
     </div> </a> 
    <div class="headerMenu"> 
     <div class="menuItem btnGroup login"></div> 
    </div> 
   </div> 
   <div id="bd" class="yui3-g"> 
    <div class="yui3-u-1-4"> 
     <div id="docs-sidebar" class="sidebar apidocs"> 
      <div id="api-list"> 
       <h2 class="off-left">APIs</h2> 
       <div id="api-tabview" class="tabview"> 
        <ul class="tabs"> 
         <li><a href="#api-classes">Classes</a></li> 
         <li><a href="#api-modules">Modules</a></li> 
        </ul> 
        <div id="api-tabview-filter"> 
         <input type="search" id="api-filter" placeholder="Type to filter APIs" /> 
        </div> 
        <div id="api-tabview-panel"> 
         <ul id="api-classes" class="apis classes"> 
          <li><a href="../classes/Dialog.html">Dialog</a></li> 
          <li><a href="../classes/Editor.html">Editor</a></li> 
          <li><a href="../classes/Explorer.html">Explorer</a></li> 
          <li><a href="../classes/Global_Variables.html">Global_Variables</a></li> 
          <li><a href="../classes/Menu.html">Menu</a></li> 
          <li><a href="../classes/onEvents.html">onEvents</a></li> 
          <li><a href="../classes/Plugin.html">Plugin</a></li> 
          <li><a href="../classes/Plugins.html">Plugins</a></li> 
          <li><a href="../classes/Resource.html">Resource</a></li> 
          <li><a href="../classes/RunJS.html">RunJS</a></li> 
          <li><a href="../classes/Utils.html">Utils</a></li> 
         </ul> 
         <ul id="api-modules" class="apis modules"> 
         </ul> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
    <div class="yui3-u-3-4"> 
     <div id="api-options">
       Show: 
      <label for="api-show-inherited"> <input type="checkbox" id="api-show-inherited" checked="" /> Inherited </label> 
      <label for="api-show-protected"> <input type="checkbox" id="api-show-protected" /> Protected </label> 
      <label for="api-show-private"> <input type="checkbox" id="api-show-private" /> Private </label> 
      <label for="api-show-deprecated"> <input type="checkbox" id="api-show-deprecated" /> Deprecated </label> 
     </div> 
     <div class="apidocs"> 
      <div id="docs-main"> 
       <div class="content"> 
        <h1 class="file-heading">File: js\editor.js</h1> 
        <div class="file"> 
         <pre class="code prettyprint linenums">
/**
 * 按视图划分，Editor负责编辑器视图的显示及操作
 * 
 * @class Editor
 */
Editor = (function() {

	var PT = Editor.prototype;

	var instance;

	/**
	 * 默认配置参数
	 * 
	 * @attribute defaultParams
	 * @private
	 */
	PT.defaultParams = {
		viewLink : buildString(editor_path, &quot;/editor&quot;),
		tplLink : buildString(editor_path, &quot;/template&quot;),
		pluginTplLink : buildString(editor_path, &quot;/plugin_tpl&quot;),
		ident : &quot;&quot;,
		theme : &quot;night&quot;
	};

	/**
	 * 事件绑定规则定义，详情见 {{#crossLink &quot;Utils&quot;}}{{/crossLink}} 类中的 {{#crossLink
	 * &quot;Utils/binder&quot;}}{{/crossLink}} 方法
	 * 
	 * @property Events
	 * @type {JSON}
	 */
	PT.Events = {
		&quot;mouseover-&gt;.editor&quot; : &quot;show_quick_tools&quot;,
		&quot;mouseout-&gt;.editor&quot; : &quot;hide_quick_tools&quot;
	};

	/**
	 * 显示视图右上角快速工具条
	 * 
	 * @method show_quick_tools
	 */
	PT.show_quick_tools = function() {
		$(this).find(&quot;.quick_tools&quot;).show();
	};

	/**
	 * 隐藏视图右上角快速工具条
	 * 
	 * @method hide_quick_tools
	 */
	PT.hide_quick_tools = function() {
		$(this).find(&quot;.quick_tools&quot;).hide();
	};

	/**
	 * @class Editor
	 * @constructor
	 */
	function Editor() {
		instance = this;
		this.arg = arguments;
		this.clazz = className(this);
		g_utils.initParams.call(this, this.defaultParams);
		this.initView.call(this);
		return this;
	}

	/**
	 * 编辑器视图初始化
	 * 
	 * @method initView
	 * @param {String}
	 *            ident 代码唯一标识
	 * @param {Boolean}
	 *            async 是否采取异步方式初始化视图
	 */
	PT.initView = function(ident, async) {
		if (isEmpty(ident))
			ident = g_status.ident;
		g_utils.initView.call(this, ident, function(ident, view) {
			this.initCodeMirror(view);
			this.editorSets = $(&quot;.editorSet&quot;);
			this.setTheme(Setting.theme);
			this.setCMFont();
			$(window).resize();
			this.updatePreview(&quot;&quot;, true);
			instance.refreshEditors();
		}, async);
		g_utils.binder.call(this);
		if (isNotEmpty(g_status.codename))
			$(&quot;title&quot;).html(buildString(g_status.codename, &quot;-RunJS&quot;));
	};

	/**
	 * 选择JS编辑类型：JavaScript或CoffeeScript
	 * 
	 * @method chooseJsType
	 */
	PT.chooseJsType = function() {
		var doNow = function(d, rd) {
			var jstype = dialog.getField(d, &quot;input[name='choose_js_type']:checked&quot;, 0);
			if (jstype.length == 0) {
				dialog.errorMsg(d, &quot;请选择其中一个类别&quot;);
				return false;
			}
			var success = function(msg) {
				runjs.initStatus(g_status.ident);
				instance.initView(g_status.ident);
				rd.close();
			};
			var fail = function(msg) {
				dialog.errorMsg(d, msg.msg);
			};
			var callback = function(msg) {
				g_utils.errorHandler(msg, success, fail, true);
			};
			Api.ajax.set_code_type(g_status.codeid, &quot;js&quot;, jstype.val(), callback);
			return false;
		};
		dialog.get(buildString(&quot;choose_code_type/js/&quot;, g_status.ident), doNothing, doNow);
	};

	/**
	 * 选择CSS编辑类型：CSS 或 LESS
	 * 
	 * @method chooseCssType
	 */
	PT.chooseCssType = function() {
		var doNow = function(d, rd) {
			var csstype = dialog.getField(d, &quot;input[name='choose_css_type']:checked&quot;, 0);
			if (csstype.length == 0) {
				dialog.errorMsg(d, &quot;请选择其中一个类别&quot;);
				return false;
			}
			var success = function(msg) {
				runjs.initStatus(g_status.ident);
				instance.initView(g_status.ident);
				rd.close();
			};
			var fail = function(msg) {
				dialog.errorMsg(d, msg.msg);
			};
			var callback = function(msg) {
				g_utils.errorHandler(msg, success, fail, true);
			};
			Api.ajax.set_code_type(g_status.codeid, &quot;css&quot;, csstype.val(), callback);
			return false;
		};
		dialog.get(buildString(&quot;choose_code_type/css/&quot;, g_status.ident), doNothing, doNow);
	};

	/**
	 * 获取当前代码的MD5值
	 * 
	 * @method codeMD5
	 */
	PT.codeMD5 = function() {
		return CryptoJS.MD5(buildString(instance.editorHtml.getValue(), instance.editorJs.getValue(), instance.editorCss.getValue())).toString();
	}
	/**
	 * 给三个视图异步加载代码
	 * 
	 * @method loadTemplate
	 * @param {String}
	 *            ident 代码唯一标识，ident为空则加载默认模版代码，ident不为空则尝试加载用户的对应代码
	 */
	PT.loadTemplate = function(ident) {
		var cur = this;
		if (isEmpty(ident) &amp;&amp; isEmpty(g_status.ident))
			ident = &quot;&quot;;
		else
			ident = g_status.ident;
		$.get(buildString(this.tplLink, &quot;/html/&quot;, ident), function(html) {
			cur.editorHtml.setValue(html);
		})
		$.get(buildString(this.tplLink, &quot;/css/&quot;, ident), function(css) {
			cur.editorCss.setValue(css);
		})
		$.get(buildString(this.tplLink, &quot;/js/&quot;, ident), function(js) {
			cur.editorJs.setValue(js);
		})
	}

	/**
	 * 加载插件模版代码
	 * 
	 * @method loadPlugin
	 * @param {String}
	 *            ident 代码唯一标识
	 * @param {String}
	 *            pname 插件类名
	 * @param {Number}
	 *            onMethod {{#crossLink &quot;Plugins/onEvents&quot;}}{{/crossLink}} 个数
	 */
	PT.loadPlugin = function(ident, pname, onMethod) {
		if (isEmpty(ident))
			ident = &quot;noident&quot;;
		var js = g_utils.load(buildString(this.pluginTplLink, &quot;/&quot;, ident, &quot;/&quot;, pname, &quot;/&quot;, onMethod), false);
		return {
			html : &quot;&quot;,
			css : &quot;&quot;,
			js : js
		};
	}

	/**
	 * 加载插件模版代码
	 * 
	 * @method loadPluginTpl
	 * @param {String}
	 *            ident 代码唯一标识
	 * @param {Number}
	 *            onMethod {{#crossLink &quot;Plugins/onEvents&quot;}}{{/crossLink}} 个数
	 */
	PT.loadPluginTpl = function(ident, onMethod) {
		var codes = instance.loadPlugin(ident, &quot;PluginName&quot;, onMethod);
		instance.editorJs.setValue(codes.js);
		instance.editorHtml.setValue(codes.html);
		instance.editorCss.setValue(codes.css);
	};

	/**
	 * 检查并设置编辑器编辑状态
	 * 
	 * @method setEditedStatus
	 */
	PT.setEditedStatus = function() {
		var curHash = instance.codeMD5();
		if (isEmpty(instance.contentHash) || instance.contentHash.length == 0) {
			// 首次加载初始化hash
			instance.contentHash = buildString(curHash, &quot;_&quot;, g_status.ident);
			instance.edited = false;
		} else {
			var ident = instance.contentHash.split(&quot;_&quot;)[1];
			var hash = instance.contentHash.split(&quot;_&quot;)[0];
			if (ident == g_status.ident &amp;&amp; hash != curHash) {
				instance.edited = true;
				$(&quot;title&quot;).html(buildString(&quot;*&quot;, $(&quot;title&quot;).html().replace(/[*]/g, &quot;&quot;)));
			} else {
				if (ident != g_status.ident) {
					instance.contentHash = buildString(curHash, &quot;_&quot;, g_status.ident);
				}
				instance.edited = false;
				$(&quot;title&quot;).html($(&quot;title&quot;).html().replace(/[*]/g, &quot;&quot;));
			}
		}
	}

	/**
	 * 移除编辑状态
	 * 
	 * @method removeEditedStatus
	 */
	PT.removeEditedStatus = function() {
		instance.edited = false;
		instance.contentHash = buildString(instance.codeMD5(), &quot;_&quot;, g_status.ident);
		$(&quot;title&quot;).html($(&quot;title&quot;).html().replace(/[*]/g, &quot;&quot;));
	}

	/**
	 * 以同步方式加载模版代码
	 * 
	 * @method getRemoteCode
	 * @param {String}
	 *            ident 代码唯一标识
	 * @param {String}
	 *            type 代码片段类型'html'|'css'|'js'
	 * @return {JSON} code 返回{html:&quot;&quot;,css:&quot;&quot;,js:&quot;&quot;}结构数据
	 */
	PT.getRemoteCode = function(ident, type) {
		return this.loadTplSnippet(ident, type, false);
	}

	/**
	 * 从远程加载代码片段，如果ident为空，则加载模版代码片段
	 * 
	 * @method loadTplSnippet
	 * @param {String}
	 *            ident 代码唯一标识
	 * @param {String}
	 *            type 代码片段类型'html'|'css'|'js'
	 * @param {Boolean}
	 *            async 是否采用异步方式加载
	 * @param {Function}
	 *            callback 异步方式的回调函数
	 * @return {JSON} code 返回{html:&quot;&quot;,css:&quot;&quot;,js:&quot;&quot;}结构数据
	 */
	PT.loadTplSnippet = function(ident, type, async, callback) {
		var cur = this;
		if (isEmpty(ident))
			ident = &quot;&quot;;
		if (isEmpty(async))
			async = true;
		switch (type) {
		case &quot;html&quot;:
		case &quot;css&quot;:
		case &quot;js&quot;:
			return $.ajax({
				url : buildString(this.tplLink, &quot;/&quot;, type + &quot;/&quot;, ident),
				success : function(html) {
					if (isFunc(callback))
						callback.call(cur, html);
				},
				async : async
			}).responseText
			break;
		default:
			return {
				html : this.loadTplSnippet(ident, &quot;html&quot;, async),
				css : this.loadTplSnippet(ident, &quot;css&quot;, async),
				js : this.loadTplSnippet(ident, &quot;js&quot;, async)
			};
		}
	}

	/**
	 * 获取当前编辑器内textarea代码
	 * 
	 * @method getCodeOfView
	 * @param {Object}
	 *            view 视图选择器
	 * @param {String}
	 *            type 编辑器类型 'html'|'css'|'js'
	 */
	PT.getCodeOfView = function(view, type) {
		if (isNotEmpty(view) &amp;&amp; isNotEmpty(type)) {
			return view.find(&quot;#code_&quot; + type).val();
		}
	}

	/**
	 * 初始化CodeMirror
	 * 
	 * @method initCodeMirror
	 * @param {Object}
	 *            view 视图选择器
	 * @param {Boolean}
	 *            是否使用编辑器textarea的默认代码
	 */
	PT.initCodeMirror = function(view, defCode) {
		var cur = this;
		var delay;
		var html, css, js;
		if (isEmpty(defCode) || defCode) {
			html = this.getDefaultEditorValue(&quot;html&quot;);
			css = this.getDefaultEditorValue(&quot;css&quot;);
			js = this.getDefaultEditorValue(&quot;js&quot;);
		} else {
			html = this.getCodeOfView(view, &quot;html&quot;);
			css = this.getCodeOfView(view, &quot;css&quot;);
			js = this.getCodeOfView(view, &quot;js&quot;);
		}
		if (isNotEmpty(view)) {
			this.editorHtml = new CodeMirror(document.getElementById(&quot;code_html&quot;).parentElement, {
				mode : &quot;text/html&quot;,
				tabSize : 2,
				indentWithTabs : true,
				value : html,
				lineNumbers : true,
				lineWrapping : true,
				matchBrackets : true,
				onChange : function(cm) {
					if (isNotEmpty(delay))
						clearTimeout(delay);
					delay = setTimeout(function() {
						cur.updatePreview();
					}, 300)
					if (isFunc(instance.onEditorHtmlChange))
						instance.onEditorHtmlChange(cm);
					plugins.fireEvent.call(cm, &quot;onHtmlEditorChange&quot;, cm);
				},
				onCursorActivity : function(cm) {
					plugins.fireEvent.call(cm, &quot;onHtmlCursorActivity&quot;, cm);
				}
			});
			this.editorCss = new CodeMirror(document.getElementById(&quot;code_css&quot;).parentElement, {
				mode : g_status.cssType == 1 ? &quot;css&quot; : &quot;less&quot;,
				tabSize : 2,
				indentWithTabs : true,
				value : css,
				lineNumbers : true,
				lineWrapping : true,
				matchBrackets : true,
				onChange : function(cm) {
					if (isNotEmpty(delay))
						clearTimeout(delay);
					delay = setTimeout(function() {
						cur.updatePreview();
					}, 300)
					if (isFunc(instance.onEditorCssChange))
						instance.onEditorCssChange(cm);
					plugins.fireEvent.call(cm, &quot;onCssEditorChange&quot;, cm);
				},
				onCursorActivity : function(cm) {
					plugins.fireEvent.call(cm, &quot;onCssCursorActivity&quot;, cm);
				}
			});
			this.editorJs = new CodeMirror(document.getElementById(&quot;code_js&quot;).parentElement, {
				mode : g_status.jsType == 1 ? &quot;javascript&quot; : &quot;coffeescript&quot;,
				tabSize : 2,
				indentWithTabs : true,
				value : js,
				lineNumbers : true,
				lineWrapping : true,
				matchBrackets : true,
				onChange : function(cm) {
					if (isNotEmpty(delay))
						clearTimeout(delay);
					delay = setTimeout(function() {
						cur.updatePreview();
					}, 300)
					if (isFunc(instance.onEditorJsChange))
						instance.onEditorJsChange(cm);
					plugins.fireEvent.call(cm, &quot;onJsEditorChange&quot;, cm);
				},
				onCursorActivity : function(cm) {
					plugins.fireEvent.call(cm, &quot;onJsCursorActivity&quot;, cm);
				}
			});
			// '隐藏'textarea
			this.target.find(&quot;textarea&quot;).attr(&quot;style&quot;, &quot;position: absolute; left: -10000px; width: 10px;&quot;);
			// 编辑器大小调整
			this.h_handler = $(&quot;.handler_horizontal&quot;).TextAreaResizer({
				vertical : false,
				html : this.editorHtml,
				css : this.editorCss,
				js : this.editorJs
			});
			this.v_handler = $(&quot;.handler_vertical&quot;).TextAreaResizer({
				vertical : true,
				html : this.editorHtml,
				css : this.editorCss,
				js : this.editorJs
			});
		} else {

		}
	};

	/**
	 * 获取CodeMirro编辑器代码
	 * 
	 * @method getEditorCode
	 * @param {String}
	 *            type 编辑器类型 'html'|'css'|'js'
	 */
	PT.getEditorCode = function(type) {
		switch (type) {
		case &quot;html&quot;:
			return this.editorHtml.getValue();
		case &quot;css&quot;:
			return this.editorCss.getValue();
		case &quot;js&quot;:
			return this.editorJs.getValue();
		default:
			return {
				html : this.getEditorCode(&quot;html&quot;),
				css : this.getEditorCode(&quot;css&quot;),
				js : this.getEditorCode(&quot;js&quot;)
			}
		}
	}

	/**
	 * 获取HTML+JS+CSS组合过后的最终页面代码，用于在预览视图中实时显示
	 * 
	 * @method getCombinedHtml
	 */
	PT.getCombinedHtml = function() {
		var js = &quot;&quot;, css = &quot;&quot;;
		var html = this.editorHtml.getValue();
		var temp = &quot;&quot;;
		if (html.indexOf(&quot;&lt;/body&gt;&quot;) &gt; -1) {
			var body = [];
			body.push(html.substring(0, html.lastIndexOf(&quot;&lt;/body&gt;&quot;)));
			body.push(html.substring(html.lastIndexOf(&quot;&lt;/body&gt;&quot;)));
			html = body[0];
			temp = body.length == 2 &amp;&amp; body[1] ? body[1] : &quot;&quot;;
		}
		try {
			if (g_status.cssType == 1) {
				css = this.editorCss.getValue();
			} else if (g_status.cssType == 2) {
				css = g_utils.load(&quot;/action/ajax/less_compile&quot;, false, undefined, this.editorCss.getValue());
			}
		} catch (e) {
			return html + temp;
		}
		try {
			if (g_status.jsType == 1) {
				js = this.editorJs.getValue();
			} else if (g_status.jsType == 2) {
				js = CoffeeScript.compile(this.editorJs.getValue());
			}
		} catch (e) {
			return buildString(html, &quot;&lt;style&gt;&quot;, css, &quot;&lt;/style&gt;&quot;, temp);
		}
		return buildString(html, &quot;&lt;script&gt;try{\n&quot;, js, &quot;\n}catch(e){\n}&lt;/script&gt;&quot;, &quot;&lt;style&gt;&quot;, css, &quot;&lt;/style&gt;&quot;, temp);
	}

	/**
	 * 更新视图的定时器实例，用来实现延时更新
	 * 
	 * @attribute update_delay
	 * @private
	 */
	var update_delay;

	/**
	 * 更新预览视图的内容
	 * 
	 * @method updatePreview
	 * @param {String}
	 *            chtml 组合过后的HTML+CSS+JS代码
	 * @param {Boolean}
	 *            是否强制更新
	 */
	PT.updatePreview = function(chtml, update) {
		instance.setEditedStatus();
		if (isNotEmpty(update_delay) &amp;&amp; g_status.cssType == 2) {
			Console.log(buildString(&quot;clear timeout(&quot; , update_delay , &quot;)&quot;));
			clearTimeout(update_delay);
		}
		update_delay = setTimeout(function() {
			if (!g_status.isOtherCode &amp;&amp; (g_status.mode == &quot;plugin&quot; &amp;&amp; isNotEmpty(update) || g_status.mode == &quot;code&quot;)) {
				var pre_wrapper = $(&quot;.preview&quot;);
				pre_wrapper.find(&quot;iframe&quot;).remove();
				var previewFrame;
				if (g_status.mode == &quot;plugin&quot; &amp;&amp; g_mode == &quot;code&quot; &amp;&amp; isNotEmpty(update)) {
					var src = buildString(g_status.host , editor_path , '/' , g_status.ident , &quot;?mode=plugin&quot;);
					previewFrame = pre_wrapper.append(buildString('&lt;iframe id=&quot;preview&quot; src=&quot;' , src , '&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;')).find(&quot;iframe&quot;)[0];
				} else {
					previewFrame = pre_wrapper.append('&lt;iframe id=&quot;preview&quot; frameborder=&quot;0&quot;&gt;&lt;/iframe&gt;').find(&quot;iframe&quot;)[0];
					var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
					preview.open();
					var html = isNotEmpty(chtml) &amp;&amp; typeOf(chtml, 'string') ? chtml : instance.getCombinedHtml();
					preview.write(html);
					preview.close();
				}
			}
		}, g_status.cssType == 2 ? 1000 : 1);
	}

	/**
	 * 获取默认代码
	 * 
	 * @method getDefaultEditorValue
	 * @param {String}
	 *            type 代码类型 'html'|'css'|'js'
	 */
	PT.getDefaultEditorValue = function(type) {
		return isNotEmpty(this[type]) ? this[type] : $(&quot;#code_&quot; + type).val();
	}

	/**
	 * 根据全局变量 Setting 中的theme属性设置主题，当前只是 default 和 night两种主题
	 * 
	 * @method setTheme
	 */
	PT.setTheme = function() {
		if (isNotEmpty(Setting.theme) &amp;&amp; (Setting.theme == &quot;default&quot; || Setting.theme == &quot;night&quot;)) {
			this.editorHtml.setOption(&quot;theme&quot;, Setting.theme);
			this.editorCss.setOption(&quot;theme&quot;, Setting.theme);
			this.editorJs.setOption(&quot;theme&quot;, Setting.theme);
			if (Setting.theme == &quot;night&quot;)
				$(&quot;body&quot;).attr(&quot;class&quot;, &quot;NightTheme&quot;);
			else
				$(&quot;body&quot;).attr(&quot;class&quot;, &quot;DefaultTheme&quot;);
		}
	}

	/**
	 * 设置CodeMirror字体，根据全局变量 Setting 中的fontfamily和fontsize属性设置字体
	 * 
	 * @method setCMFont
	 */
	PT.setCMFont = function() {
		$(&quot;.CodeMirror&quot;).ready(function() {
			// 初始化字体
			var fontsize = 12;
			var fontfamily = &quot;consolas&quot;;

			if (typeof Setting.fontsize != 'undefined') {
				fontsize = Setting.fontsize;
			} else {
				Setting.fontsize = fontsize;
			}

			if (typeof Setting.fontfamily != 'undefined') {
				fontfamily = Setting.fontfamily;
			} else {
				Setting.fontfamily = fontfamily;
			}

			$(&quot;.CodeMirror&quot;).css({
				&quot;font-family&quot; : fontfamily,
				&quot;font-size&quot; : fontsize + &quot;px&quot;
			});

			instance.refreshEditors();
		});
	}

	/**
	 * 刷新编辑器，当编辑器外观或大小被改变时调用
	 * 
	 * @method refreshEditors
	 */
	PT.refreshEditors = function() {
		this.editorHtml.refresh()
		this.editorCss.refresh()
		this.editorJs.refresh()
	};

	return Editor;
})();
    </pre> 
        </div> 
       </div> 
      </div> 
     </div> 
    </div> 
   </div> 
  </div> 
  <script src="../assets/vendor/prettify/prettify-min.js"></script> 
  <script>prettyPrint();
  </script> 
  <script src="../assets/js/yui-prettify.js"></script> 
  <script src="../assets/../api.js"></script> 
  <script src="../assets/js/api-filter.js"></script> 
  <script src="../assets/js/api-list.js"></script> 
  <script src="../assets/js/api-search.js"></script> 
  <script src="../assets/js/apidocs.js"></script>   
  <script type="text/javascript">document.write('<link rel="stylesheet" href="/css/runjs_api.css" id="site_styles">');
  </script>
 </body>
</html>